﻿<Window x:Uid="Window_1" x:Class="ejpClient.ejpWindows.PublishAssignmentWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ejs="clr-namespace:ejpClient.ejpWindows"
    Title="アサインメント公開"
    ResizeMode="NoResize" WindowStyle="ToolWindow" WindowStartupLocation="CenterOwner"
	Width="650" Height="600">
    <Window.Background>
        <ImageBrush x:Uid="ImageBrush_1" Stretch="None" TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute" 
                           ImageSource="pack://application:,,,/imgData/bgtile.png" />
    </Window.Background>
    <Window.Resources>
        <ejs:ObservableCourseList x:Uid="ejs:ObservableCourseList_1" x:Key="CourseList"/>
        <ejs:ObservableAssignmentList x:Uid="ejs:ObservableAssignmentList_1" x:Key="AssignmentList"/>
        <ejs:CourseSqlDateConverter x:Uid="ejs:CourseSqlDateConverter_1" x:Key="SqlDateConverter"/>
        <ejs:StudyListToStudyCount x:Uid="ejs:StudyListToStudyCount_1" x:Key="StudyCountConverter"/>
    </Window.Resources>
    <Grid x:Uid="LayoutRoot" x:Name="LayoutRoot" Margin="15,15,15,15">
        <Rectangle x:Uid="Rectangle_1" Stroke="{x:Null}" Margin="0,0,0,0" RadiusX="15.5" RadiusY="15.5">
            <Rectangle.Fill>
                <LinearGradientBrush x:Uid="LinearGradientBrush_1" EndPoint="1,0.5" StartPoint="0,0.5">
                    <GradientStop x:Uid="GradientStop_1" Color="#FF7FB2F0" Offset="0"/>
                    <GradientStop x:Uid="GradientStop_2" Color="#FFFAFAFA" Offset="1"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Rectangle x:Uid="Rectangle_2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" 
                   Fill="#FFFFFFFF" Stroke="#FF7FB2F0" Margin="10,16,10,16" RadiusX="13.5" RadiusY="13.5"/>

        <Canvas x:Uid="Canvas_1" DataContext="{Binding Path=SelectedValue, ElementName=_lv_Assignments, Mode=Default}">
            <Rectangle x:Uid="Rectangle_3" Fill="{StaticResource MainToudaiLogo}" Width="215" Height="30" Canvas.Top="29" Canvas.Left="21.435" />
            <TextBlock x:Uid="TextBlock_1" Width="Auto" Height="13" TextWrapping="Wrap" Text="ログイン：" Canvas.Left="345" Canvas.Top="29" FontSize="10"/>
            <TextBlock x:Uid="_tb_LoginName" Width="Auto" Height="13" TextWrapping="Wrap" Text="" x:Name="_tb_LoginName" Canvas.Left="399" Canvas.Top="29" FontSize="10"/>
            <TextBlock x:Uid="TextBlock_2" Width="48" Height="16" Canvas.Left="347" Canvas.Top="54" Text="コース：" TextWrapping="Wrap"/>
            <ComboBox x:Uid="_cb_Courses" x:Name="_cb_Courses" Width="166.313" Height="22" Canvas.Left="399" Canvas.Top="54" IsSynchronizedWithCurrentItem="True"
                      ItemsSource="{Binding Mode=OneWay, Source={StaticResource CourseList}}" DisplayMemberPath="_name"
                      SelectionChanged="OnCourseListSelectionChanged"/>
            <ListView x:Uid="_lv_Assignments" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Mode=OneWay, Source={StaticResource AssignmentList}}"
                      x:Name="_lv_Assignments" Width="545.878" Height="378" Canvas.Left="21.435" Canvas.Top="89">
                <ListView.View>
                    <GridView x:Uid="GridView_1">
                        <GridViewColumn x:Uid="GridViewColumn_1" DisplayMemberBinding="{Binding Path=Title}" Header="課題名"/>
                        <GridViewColumn x:Uid="GridViewColumn_2" DisplayMemberBinding="{Binding Path=studies, Converter={StaticResource StudyCountConverter}}" Header="Study数"/>
                        <GridViewColumn x:Uid="GridViewColumn_3" DisplayMemberBinding="{Binding Path=OwnerName}" Header="作成者"/>
                        <GridViewColumn x:Uid="GridViewColumn_4" DisplayMemberBinding="{Binding Path=LastModifiedDate, Converter={StaticResource SqlDateConverter}}" Header="公開日時"/>
                    </GridView>
                </ListView.View>
            </ListView>
            <!--
            <TextBlock x:Uid="TextBlock_3" Text="課題名：" FontSize="12" Height="15.827" Canvas.Left="38.583" Canvas.Top="484.806" Width="48.586" />
            <TextBox x:Uid="_l_SaveFileName" x:Name="_l_SaveFileName" MaxLength="25" MaxLines="1" TextWrapping="NoWrap" Width="253" Height="22" Canvas.Left="96" Canvas.Top="483" />
            <Button x:Uid="Button_1" Width="78.595" Height="24.293" Content="キャンセル" Canvas.Left="488.718" Canvas.Top="481.573" Click="OnCancel"/>
            <Button x:Uid="Button_2" Width="79" Height="24.293" Content="公開" Canvas.Left="365" Canvas.Top="481.573" Click="OnPublishAssignment"/>
            -->
            <StackPanel x:Uid="StackPanel_1" Orientation="Horizontal" HorizontalAlignment="Right" Canvas.Right="48" Canvas.Top="480">
                <TextBlock x:Uid="TextBlock_3" Text="課題名：" FontSize="12" Height="Auto" Margin="38,5,5,0" Width="Auto" />
                <TextBox x:Uid="_l_SaveFileName" x:Name="_l_SaveFileName" MaxLength="25" MaxLines="1" TextWrapping="NoWrap" Width="270" Height="Auto" Margin="5,3,5,0" />
                <Button x:Uid="Button_2" Width="Auto" Height="Auto" Content="公開" Margin="5,3,5,0" Padding="20,0,20,0" Click="OnPublishAssignment"/>
                <Button x:Uid="Button_1" Width="Auto" Height="Auto" Content="キャンセル" Margin="5,3,0,0" Padding="5,0,5,0" Click="OnCancel"/>
            </StackPanel> 
        </Canvas>
    </Grid>
</Window>
